<template>
  <!--专栏页面-->
  <div class="curriculum">
    <div class="curr_back">
      <img src="../../../static/image/currentduan.png" />
    </div>
    <div
      class="Valueaddedtax_box"
      v-for="(item, index) in coilummList"
      :key="index"
    >
      <div class="Valueaddedtax_txt">
        <span style="margin-left: 0.30rem;font-size:0.30rem;">{{
          item.name
        }}</span>
        <span
          style="margin-right:0.30rem;font-size:0.24rem;color:#333333;"
          @click="getMore(item.id, item.name)"
          >查看更多</span
        >
      </div>
      <div class="Valueaddedtax">
        <div
          class="Valueaddedtax_txt1"
          v-for="(i, j) in item.columns"
          :key="j"
          @click="valueTxt(i)"
        >
          <div class="Valueaddedtax_img">
            <img :src="i.imgUrl" />
          </div>
          <div class="Valueaddedtax_cend">
            <div>{{ i.name }}</div>
            <div
              style="display:flex;justify-content: space-between;margin-top:0.50rem;"
            >
              <span style="color:#ccc;font-size:0.25rem;"
                >{{ i.buyNum }}人开通</span
              >
              <span style="font-size:0.25rem;">￥{{ i.price }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <footer>
      <Footers></Footers>
    </footer>
  </div>
</template>
<script>
import axios from "axios";
import Footers from "../footer";
import { columnResult } from "../../api/api";
import querystring from "query-string";
import { Toast, Indicator } from "mint-ui";

export default {
  name: "HelloWorld",
  components: {
    Footers
  },
  data() {
    return {
      coilummList: []
    };
  },
  methods: {
    //专栏详情
    coulmm() {
      let that = this;
      that.bus.$emit("loading", true); //开始
      let params = {};
      params = querystring.stringify(params);
      let a = localStorage.getItem("token");
      a = JSON.parse(a);
      columnResult(params, a).then(res => {
        console.log(res);
        if (res.data.code == 1) {
          this.coilummList = res.data.data;
        } else {
          Toast(res.data.message);
        }
        that.bus.$emit("loading", false); //结束
      });
    },
    //跳转更多
    getMore(e, i) {
      // this.$router.push({ name: "Geneasier", params: { id: e, name: i } });
      this.$router.push({
        path: "/Generalhospital/easier",
        query: { id: e, name: i }
      });
    },
    //专栏详情
    valueTxt(item) {
      this.$router.push({
        path: "/Branch/catalog",
        query: { columnId: item.columnId }
      });
    }
  },
  mounted() {
    this.coulmm();
  }
};
</script>
<style lang="scss" scoped>
/* 专栏 */
.curriculum {
  width: 100%;
  height: auto;
  padding-bottom: 1rem;
}
.curr_back {
  width: 100%;
  height: 1.7rem;
  position: relative;
}
.curr_back img {
  width: 100%;
  height: 100%;
}
.Valueaddedtax_box {
  width: 100%;
  height: auto;
  border-bottom: 0.2rem solid #eeeeee;
}

.Valueaddedtax {
  width: 7rem;
  height: auto;
  margin: auto;
}
.Valueaddedtax_txt {
  display: flex;
  justify-content: space-between;
  height: 0.78rem;
  line-height: 0.78rem;
  border: 0.02rem solid #eeeeee;
}
.Valueaddedtax_txt:nth-of-type(1) {
  border-bottom: 0.02rem solid #eeeeee;
}
.Valueaddedtax_txt1 {
  display: flex;
  justify-content: space-between;
  height: 2.21rem;
  border-bottom: 0.02rem solid #eeeeee;
}
.Valueaddedtax_txt1:nth-last-child(1) {
  border: none;
}
.Valueaddedtax_img {
  width: 2.1rem;
  height: 1.6rem;
  margin: auto;
  margin-left: 0.2rem;
}
.Valueaddedtax_img img {
  width: 100%;
  height: 100%;
}
.Valueaddedtax_cend {
  width: 4.45rem;
  font-size: 0.3rem;
  padding: 0.26rem;
}
</style>